/**
 * 办件登记的api接口
 */
import request from "@/utils/request";

/**
 * 保存更新办件的基本信息
 * @param {*} data
 * @returns
 */
export function saveOrUpdateCaseInfo(data = {}) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/zcbl/caseRegister/saveOrUpdateCaseInfo",
    method: "post",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    },
    data: data
  });
}

/**
 * 保存办件登记的材料数据
 * @param {*} caseOid
 * @param {*} data
 * @returns
 */
export function saveOrUpdateCaseMaterial(caseOid = "", data = {}) {
  if (caseOid && data) {
    return request({
      url:
        process.env.VUE_APP_KSTB_ROUTE_PATH +
        `/zcbl/caseRegister/saveOrUpdateCaseMaterial/${caseOid}`,
      method: "post",
      headers: {
        "Content-Type": "application/json;charset=UTF-8"
      },
      data: data
    });
  }
}

/**
 * 保存受理操作
 * @param {*} data
 */
export function saveCaseAccept(data = {}) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH + "/zcbl/caseRegister/saveCaseAccept",
    method: "post",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    },
    data: data
  });
}
